/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.dto.sqlServer;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;

import javax.annotation.Nullable;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author zhangYY
* @date 2024-01-12
**/
@Entity
@Data
@Table(name="processcard")
public class Processcard implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "工艺卡id")
    private Integer id;

    @Column(name = "`processcard_code`",unique = true,nullable = false)
    @NotBlank
    @ApiModelProperty(value = "工艺卡编码")
    private String processcardCode;

    @Column(name = "`work_num`")
    @ApiModelProperty(value = "工程号")
    private String workNum;

    @Column(name = "`product_type`")
    @ApiModelProperty(value = "产品类型")
    private String productType;

    @Column(name = "`material`")
    @ApiModelProperty(value = "材质")
    private String material;

    @Column(name = "`thick`")
    @ApiModelProperty(value = "厚度")
    private Double thick;

    @Column(name = "`size1`")
    @ApiModelProperty(value = "板子尺寸1")
    private Double size1;

    @Column(name = "`size2`")
    @ApiModelProperty(value = "板子尺寸2")
    private Double size2;

    @Column(name = "`qty`")
    @ApiModelProperty(value = "板子数量")
    private Integer qty;

    @Column(name = "`layer_name`")
    @ApiModelProperty(value = "压合层名")
    private String layerName;

    @Column(name = "`new_layer_name`")
    @ApiModelProperty(value = "新增压合程式")
    @Nullable
    private String newLayerName;

    public void copy(Processcard source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
